package com.example.wujinapi.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.wujinapi.comm.R;
import com.example.wujinapi.entity.Products;
import com.example.wujinapi.entity.Productspecification;
import com.example.wujinapi.service.ProductspecificationService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * (Productspecification)表控制层
 *
 * @author makejava
 * @since 2023-07-31 23:01:46
 */
@RestController
@RequestMapping("productspecification/")
public class ProductspecificationController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private ProductspecificationService productspecificationService;

    /**
     * 获取产品规格
     */
    @GetMapping("/getProductspecificationByspId/{spid}")
    public R getProductspecificationByspId(@PathVariable("spid") Integer spid){
        try {
            Productspecification spData=productspecificationService.getProductspecificationByspId(spid);
            return R.ok().put("data",spData);
        } catch (Exception e) {
            e.printStackTrace();
            return R.error(400,"获取产品规格失败");
        } finally {

        }
    }

}

